vcTopologyPickService

TopologyPickService provides options for handling the selection and creation of points, lines, and curves using the interactiveTopologyPick command. Note 1: TopologyPickService should not be used at the same time by multiple scripts. Note 2: vcSnapService and vcTopologyPickService should not be used at the same time.

See in: Overview

Module: vcCore

Parent: -

Children -

Referenced by: vcApplication.TopologyPickService

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
ContinuousModeBooleanRWGets or sets the use of continuous curve selection in 3D world.
SnapOnCurveBooleanRWGets or sets the ability to select a curve.
SnapOnCurveLoopBooleanRWGets or sets the ability to select a curve loop.
SnapOnSurfaceBooleanRWGets or sets the ability to select a point on a face.
TargetAvailableBooleanRGets if pointing at a valid target.
TargetCurveAvailableBooleanRGets if pointing at an available curve.
TargetCurveIndexIntegerRGets the index of an available curve.
TargetCurveLoopAvailableBooleanRGets if pointing at an available curve loop.
TargetCurveLoopIndexIntegerRGets the index of an available curve loop.
TargetCurveslist[vcPickedTopologyCurveInfo]RGets a list of vcPickedTopologyCurveInfo for target.
TargetGeometrySetvcObjectRGets geometry set of a target.
TargetLockedBooleanRGets if target has been selected in 3D world.
TargetNodevcObjectRGets the node containing target.
TargetNormalvcVectorRIf available, gets surface normal of target.
TargetNormalAvailableBooleanRGets if surface normal is available for target.
TargetPositionvcVectorRGets the position vector of target in World coordinate system.
TargetSurfaceAvailableBooleanRGets if pointing at an available point on surface.
TargetSurfaceIndexIntegerRGets the index of an available surface.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
clearNoneNoneStops and resets the command and clears its target data (in every instance of both vcTopologyPickService and vcSnapService).
See more
Removes all registered callbacks (of this script).
Triggers an OnCanceled event in this script (if called from outside and event handler) and in other scripts (always).
executeNoneNoneRuns the vcTopologyPickService.
Before calling this, make sure you call clear().
See more
Then (re)set the needed properties, (re)add the needed event handlers and finnaly call execute().

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnCanceledNoneTriggered when the snap action is canceled.
See more
If not provided, the default implementation calls clear().
If provided, you handler should call clear() to avoid potential issues with other scripts using vcSnapService or vcTopologyPickService.
OnTargetAvailableNoneTriggered when pointer is hovering over a valid target in 3D world.
OnTargetSetNoneTriggered when a valid target has been selected in 3D world.
See more
Your handler should call clear() to avoid potential issues with other scripts using vcSnapService or vcTopologyPickService.

Example: Topology Selection Continuous

"""Implement continuous selection with the vcTopologyPickService and print target curves."""
import vcCore as vc

def target_set():
    print("TargetSet")
    for curve_info in cmd.TargetCurves:
        print(curve_info)

app = vc.getApplication()
cmd = app.TopologyPickService
cmd.ContinuousMode = True
cmd.OnTargetSet += target_set
cmd.execute()